#使用 yield的斐波那契函数定义
def get_fibonacci(max):
    n1 = 0
    n2 = 1
    num = 0
    while num < max:
        yield n1
        n1, n2 = n2, n1 + n2
        num += 1

#主函数
if __name__ == "__main__":
    for i in get_fibonacci(10):
        print(i, end=' ')
    